home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / helicopter.swf / scripts / frame_5 / PlaceObject2_29_11 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  588 b   |  25 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.helicopter.scrollStart == true)
  3.    {
  4.       y1 = this._y;
  5.       y1Max = _root.movieHeight - this._height / 2 - 5;
  6.       y1Min = this._height / 2 + 5;
  7.       range = y1Max - y1Min;
  8.       if(y2 + 5 >= y1 && y1 >= y2 - 5)
  9.       {
  10.          y2 = random(range) + this._height / 2;
  11.          x = random(60) + 1;
  12.          ySpeed = (y2 - y1) / x;
  13.       }
  14.       this._y += ySpeed;
  15.       if(180 < this._height)
  16.       {
  17.          this._height -= shrinkSpeed;
  18.       }
  19.    }
  20.    if(_root.restart == true)
  21.    {
  22.       this.removeMovieClip();
  23.    }
  24. }
  25.